﻿@model Merp.Web.Site.Areas.Accountancy.Models.Invoice.OutgoingInvoicesNotLinkedToAJobOrderViewModel

@{
    ViewBag.Title = "OutgoingInvoicesNotLinkedToAJobOrderViewModel";
}
<script>
    (function () {
        var homePageApp = angular.module('myApp', []);
    }());
    (function (module) {
        var invoicesController = function ($scope, $http) {
            $scope.refreshInvoiceList = function () {
                var url = '/Accountancy/Invoice/ListOfOutgoingInvoicesNotLinkedToAJobOrder';
                $http.get(url).success(function (data) {
                    $scope.Invoices = data;
                });
            }
            $scope.refreshInvoiceList();
        }
        module.controller('invoicesController', ['$scope', '$http', invoicesController]);
    }(angular.module('myApp')))
</script>


<div class="row">
    <h2>OugoingInvoicesNotAssignedToAJobOrder</h2>
    <div id="InvoicesBox" data-ng-app="myApp" data-ng-controller="invoicesController">
        <label for="InvoicesTable">Invoices</label>&nbsp;(<a id="refreshInvoiceList" data-ng-click="refreshInvoiceList()">refresh</a>)
        <table id="InvoicesTable" class="table table-striped">
            <thead>
                <tr>
                    <td>Customer name</td>
                    <td>Job Order name</td>
                </tr>
            </thead>
            <tbody>
                <tr data-ng-repeat="invoice in Invoices">
                    <td>{{invoice.CustomerName}}</td>
                    <td><a href="/Accountancy/Invoice/LinkOutgoingInvoiceToJobOrder/{{invoice.OriginalId}}">{{invoice.Number}}</a></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
